Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Oct 25, 2025

Summary by CodeRabbit

Release Notes

  • Chores

    • Added end-to-end testing environment for Solid Router generator with full project configuration.
  • Tests

    • New Playwright test suite covering navigation flows, nested layouts, pathless layouts, post listing and detail views, and error handling scenarios with Tailwind CSS styling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 25, 2025

Walkthrough

Introduces a complete new end-to-end test environment package for Solid Router generator at e2e/solid-router/generator-cli-only/, including project configuration, route structure, utilities, and Playwright-based tests for validating the CLI-generated application.

Changes

Cohort / File(s) Summary
Build & Runtime Configuration
package.json, tsconfig.json, vite.config.js, postcss.config.mjs, tsr.config.json
Configures build tooling (Vite, PostCSS, TypeScript, TSR) and npm workspace package with development and e2e testing scripts; enables SolidJS support and Tailwind CSS.
Project Metadata & Ignores
.gitignore
Excludes common build artifacts, node_modules, test reports, and platform-specific files.
HTML Entry Point
index.html
Minimal HTML template for Vite app with root element and module script loading src/main.tsx.
Router Bootstrap & Styling
src/main.tsx, src/styles.css
Initializes TanStack Solid Router with idempotent mounting, module augmentation for type safety, and Tailwind CSS styling.
Utilities
src/posts.ts
Provides post-fetching API (fetchPosts, fetchPost) with test-mode URL switching and error handling via NotFoundError.
Generated Route Configuration
src/routeTree.gen.ts
Generates complete hierarchical route tree with TypeScript interfaces mapping routes by full path, to-path, and id; includes module augmentation for type-safe route registration.
Root & Layout Routes
src/routes/__root.tsx, src/routes/_pathlessLayout.tsx, src/routes/_pathlessLayout/_nested-layout.tsx
Defines root route with navigation and not-found component, pathless layout patterns with nested layouts and Outlets for composition.
Route Modules
src/routes/index.tsx, src/routes/posts.route.tsx, src/routes/posts.index.tsx, src/routes/posts.$postId.tsx, src/routes/_pathlessLayout/_nested-layout/route-*.tsx
Implements file-based routes for homepage, posts list, post detail (with loader and error handling), and nested pathless layout child routes.
Playwright Test Configuration
playwright.config.ts
Configures Playwright with Chromium browser, test directory, webServer setup using Vite, and conditional server reuse outside CI.
Test Setup & Teardown
tests/setup/global.setup.ts, tests/setup/global.teardown.ts
Manages dummy e2e server lifecycle via e2eStartDummyServer and e2eStopDummyServer utilities.
End-to-End Tests
tests/app.spec.ts
Validates post navigation, nested pathless layouts, and not-found routing behavior using role-based selectors and assertions.

Sequence Diagram

sequenceDiagram
    participant Browser
    participant Vite as Vite Server
    participant App as Solid App
    participant Router as TanStack Router
    participant API as Posts API

    Browser->>Vite: Request index.html
    Vite-->>Browser: Serve HTML + main.tsx
    Browser->>App: Initialize main.tsx
    App->>Router: createRouter(routeTree.gen)
    App->>App: Render RouterProvider
    Browser->>Browser: Render Root Navigation
    
    rect rgb(200, 220, 255)
        note right of Browser: Navigate to /posts
        Browser->>Router: Navigate /posts
        Router->>API: Fetch posts (loader)
        API-->>Router: Posts array
        Router->>App: Update Posts Component
        App-->>Browser: Render posts list
    end
    
    rect rgb(200, 220, 255)
        note right of Browser: Navigate to /posts/$postId
        Browser->>Router: Navigate /posts/1
        Router->>API: Fetch post(1)
        API-->>Router: Post details
        Router->>App: Update Post Detail
        App-->>Browser: Render post with title/body
    end
    
    rect rgb(255, 220, 200)
        note right of Browser: Navigate pathless layout
        Browser->>Router: Navigate /_pathlessLayout/_nested-layout/route-a
        Router->>App: Render Pathless Layout + Nested Layout + Route A
        App-->>Browser: Render full layout hierarchy
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Extensive file additions across multiple directories with varied purposes (configuration, routes, tests, utilities)
  • Generated route tree (src/routeTree.gen.ts) contains complex TypeScript interfaces and module augmentations requiring careful review
  • Route files follow repetitive patterns, reducing per-file review complexity
  • Configuration files are straightforward (standard Vite, Playwright, PostCSS setup)
  • E2E tests are simple navigation and assertion patterns

Areas requiring extra attention:

  • src/routeTree.gen.ts — validate TypeScript type exports, interface augmentation correctness, and route hierarchy structure
  • src/main.tsx — verify router initialization, module augmentation syntax, and idempotent mounting guard
  • playwright.config.ts — confirm webServer port configuration and CI/non-CI server reuse logic
  • src/routes/posts.$postId.tsx — review loader, error component, and not-found component error handling flows

Possibly related PRs

Suggested labels

package: solid-router

Suggested reviewers

  • brenelz
  • schiller-manuel

Poem

🐰 A shiny CLI-only nest,
With routes and trees now put to test,
Pathless layouts, posts that leap,
Solid tests run deep, so deep!
Let the Playwright dance with glee—
E2E checks the canopy! 🌳

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "test(solid-router): generator-cli-only e2e suite" directly and accurately reflects the main change, which is the addition of a comprehensive end-to-end testing suite for Solid Router in the new e2e/solid-router/generator-cli-only directory. The title follows conventional commit formatting, is concise and specific, clearly indicating it adds a new e2e testing suite without using vague language. A developer reviewing the pull request history would immediately understand that this introduces a new test suite for the generator-cli-only variant of Solid Router.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test(solid-router)--generator-cli-only

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Oct 25, 2025

View your CI Pipeline Execution ↗ for commit 07aba84

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 7m View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 25s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-25 23:15:07 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 25, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5625

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5625

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5625

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5625

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5625

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5625

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5625

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5625

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5625

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5625

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5625

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5625

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5625

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5625

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5625

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5625

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5625

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5625

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5625

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5625

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5625

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5625

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5625

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5625

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5625

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5625

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5625

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5625

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5625

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5625

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5625

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5625

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5625

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5625

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5625

commit: 07aba84

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (6)
e2e/solid-router/generator-cli-only/src/styles.css (1)

3-18: Consider removing redundant border-color declarations.

The @layer base block (lines 3-11) sets border-color using a CSS variable, and then the universal selector at lines 16-17 applies border utilities again using @apply. This creates redundancy. Since Tailwind v4 handles theming internally, consider removing the @layer base block and relying solely on the @apply utilities for consistency.

Apply this diff to remove the redundancy:

-@layer base {
-  *,
-  ::after,
-  ::before,
-  ::backdrop,
-  ::file-selector-button {
-    border-color: var(--color-gray-200, currentcolor);
-  }
-}
-
 html {
   color-scheme: light dark;
 }
e2e/solid-router/generator-cli-only/package.json (1)

11-11: Consider cross-platform compatibility for the cleanup command.

The rm -rf command is Unix-specific and won't work on Windows systems. While this is commonly used in Node.js projects, consider using a cross-platform alternative for better portability.

You could use Node.js built-in fs methods or a package like rimraf:

-    "test:e2e": "rm -rf port*.txt; playwright test --project=chromium"
+    "test:e2e": "node -e \"require('fs').readdirSync('.').filter(f=>f.match(/^port.*\\.txt$/)).forEach(f=>require('fs').unlinkSync(f))\" && playwright test --project=chromium"

Or keep the current Unix-specific approach if the project primarily targets Unix-like environments.

e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)

9-11: Add an explicit component return type for stricter TS.

Keeps strict mode happy and aligns with codebase patterns.

Apply this diff:

-import { createFileRoute } from '@tanstack/solid-router'
+import { createFileRoute } from '@tanstack/solid-router'
+import type { JSX } from 'solid-js'
@@
-function LayoutAComponent() {
+function LayoutAComponent(): JSX.Element {
   return <div>I'm layout A!</div>
 }
e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx (2)

21-23: Coerce postId to string when building params.

Prevents accidental number→string mismatches at runtime.

-                  params={{
-                    postId: post.id,
-                  }}
+                  params={{
+                    postId: String(post.id),
+                  }}

15-32: Consider Solid’s for keyed lists.

Improves update performance and avoids re-creating arrays each render.

Example refactor:

-      <ul class="list-disc pl-4">
-        {[...posts(), { id: 'i-do-not-exist', title: 'Non-existent Post' }].map(
-          (post) => {
-            return (
-              <li class="whitespace-nowrap">
+      <ul class="list-disc pl-4">
+        <For each={[...posts(), { id: 'i-do-not-exist', title: 'Non-existent Post' }]}>
+          {(post) => (
+            <li class="whitespace-nowrap">
               <Link
                 to="/posts/$postId"
                 params={{
-                    postId: post.id,
+                    postId: String(post.id),
                 }}
                 class="block py-1 text-blue-600 hover:opacity-75"
                 activeProps={{ class: 'font-bold underline' }}
               >
                 <div>{post.title.substring(0, 20)}</div>
               </Link>
-              </li>
-            )
-          },
-        )}
+            </li>
+          )}
+        </For>
       </ul>
e2e/solid-router/generator-cli-only/src/posts.ts (1)

5-9: Export the PostType for reuse across routes/tests.

Keeps types consistent where needed.

-type PostType = {
+export type PostType = {
   id: string
   title: string
   body: string
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40e3a6b and 07aba84.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (24)
  • e2e/solid-router/generator-cli-only/.gitignore (1 hunks)
  • e2e/solid-router/generator-cli-only/index.html (1 hunks)
  • e2e/solid-router/generator-cli-only/package.json (1 hunks)
  • e2e/solid-router/generator-cli-only/playwright.config.ts (1 hunks)
  • e2e/solid-router/generator-cli-only/postcss.config.mjs (1 hunks)
  • e2e/solid-router/generator-cli-only/src/main.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/posts.ts (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routeTree.gen.ts (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/__root.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/index.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/posts.index.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx (1 hunks)
  • e2e/solid-router/generator-cli-only/src/styles.css (1 hunks)
  • e2e/solid-router/generator-cli-only/tests/app.spec.ts (1 hunks)
  • e2e/solid-router/generator-cli-only/tests/setup/global.setup.ts (1 hunks)
  • e2e/solid-router/generator-cli-only/tests/setup/global.teardown.ts (1 hunks)
  • e2e/solid-router/generator-cli-only/tsconfig.json (1 hunks)
  • e2e/solid-router/generator-cli-only/tsr.config.json (1 hunks)
  • e2e/solid-router/generator-cli-only/vite.config.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • e2e/solid-router/generator-cli-only/tests/setup/global.teardown.ts
  • e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • e2e/solid-router/generator-cli-only/playwright.config.ts
  • e2e/solid-router/generator-cli-only/src/posts.ts
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx
  • e2e/solid-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/solid-router/generator-cli-only/tests/app.spec.ts
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx
  • e2e/solid-router/generator-cli-only/tests/setup/global.setup.ts
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx
  • e2e/solid-router/generator-cli-only/src/routes/index.tsx
  • e2e/solid-router/generator-cli-only/src/main.tsx
  • e2e/solid-router/generator-cli-only/src/routes/__root.tsx
  • e2e/solid-router/generator-cli-only/src/routeTree.gen.ts
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

Store end-to-end tests under the e2e/ directory

Files:

  • e2e/solid-router/generator-cli-only/tests/setup/global.teardown.ts
  • e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • e2e/solid-router/generator-cli-only/src/styles.css
  • e2e/solid-router/generator-cli-only/index.html
  • e2e/solid-router/generator-cli-only/playwright.config.ts
  • e2e/solid-router/generator-cli-only/src/posts.ts
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx
  • e2e/solid-router/generator-cli-only/tsconfig.json
  • e2e/solid-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/solid-router/generator-cli-only/tests/app.spec.ts
  • e2e/solid-router/generator-cli-only/package.json
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx
  • e2e/solid-router/generator-cli-only/vite.config.js
  • e2e/solid-router/generator-cli-only/postcss.config.mjs
  • e2e/solid-router/generator-cli-only/tests/setup/global.setup.ts
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx
  • e2e/solid-router/generator-cli-only/src/routes/index.tsx
  • e2e/solid-router/generator-cli-only/tsr.config.json
  • e2e/solid-router/generator-cli-only/src/main.tsx
  • e2e/solid-router/generator-cli-only/src/routes/__root.tsx
  • e2e/solid-router/generator-cli-only/src/routeTree.gen.ts
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx
  • e2e/solid-router/generator-cli-only/src/routes/posts.index.tsx
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx
  • e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx
  • e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx
  • e2e/solid-router/generator-cli-only/src/routes/index.tsx
  • e2e/solid-router/generator-cli-only/src/routes/__root.tsx
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace:* protocol for internal dependencies in package.json files

Files:

  • e2e/solid-router/generator-cli-only/package.json
🧠 Learnings (3)
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
PR: TanStack/router#0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript in strict mode with extensive type safety across the codebase

Applied to files:

  • e2e/solid-router/generator-cli-only/tsconfig.json
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
PR: TanStack/router#5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.

Applied to files:

  • e2e/solid-router/generator-cli-only/tests/app.spec.ts
  • e2e/solid-router/generator-cli-only/src/routeTree.gen.ts
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
PR: TanStack/router#5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.

Applied to files:

  • e2e/solid-router/generator-cli-only/src/routeTree.gen.ts
🧬 Code graph analysis (13)
e2e/solid-router/generator-cli-only/tests/setup/global.teardown.ts (1)
scripts/set-ts-version.js (1)
  • packageJson (33-33)
e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx (3)
e2e/solid-router/generator-cli-only/src/routes/posts.index.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx (1)
  • Route (4-7)
e2e/solid-router/generator-cli-only/src/posts.ts (1)
  • fetchPost (24-36)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (5)
e2e/solid-router/generator-cli-only/src/routes/__root.tsx (1)
  • Route (4-14)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
  • Route (3-7)
e2e/solid-router/generator-cli-only/src/routes/index.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/posts.ts (1)
e2e/react-router/js-only-file-based/src/posts.js (1)
  • queryURL (5-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx (3)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)
  • Route (3-7)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
  • Route (3-7)
e2e/solid-router/generator-cli-only/src/routes/posts.index.tsx (2)
e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx (1)
  • Route (5-12)
e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx (1)
  • Route (4-7)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (3)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)
  • Route (3-7)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
  • Route (3-7)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (3)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)
  • Route (3-7)
e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx (2)
e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx (1)
  • Route (5-12)
e2e/solid-router/generator-cli-only/src/posts.ts (1)
  • fetchPosts (17-22)
e2e/solid-router/generator-cli-only/src/routes/index.tsx (1)
e2e/solid-router/generator-cli-only/src/routes/__root.tsx (1)
  • Route (4-14)
e2e/solid-router/generator-cli-only/src/main.tsx (1)
e2e/react-router/js-only-file-based/src/main.jsx (2)
  • router (8-13)
  • rootElement (15-15)
e2e/solid-router/generator-cli-only/src/routes/__root.tsx (8)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-a.tsx (1)
  • Route (3-7)
e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)
  • Route (3-7)
e2e/solid-router/generator-cli-only/src/routes/index.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx (1)
  • Route (5-12)
e2e/solid-router/generator-cli-only/src/routes/posts.index.tsx (1)
  • Route (3-5)
e2e/solid-router/generator-cli-only/src/routes/posts.route.tsx (1)
  • Route (4-7)
e2e/solid-router/generator-cli-only/src/routeTree.gen.ts (1)
e2e/react-router/js-only-file-based/src/routeTree.gen.js (12)
  • PathlessLayoutRoute (21-24)
  • PostsRouteRoute (25-29)
  • PostsIndexRoute (35-39)
  • PathlessLayoutNestedLayoutRoute (45-49)
  • PathlessLayoutNestedLayoutRouteBRoute (50-55)
  • PathlessLayoutNestedLayoutRouteARoute (56-61)
  • PostsRouteRouteWithChildren (68-70)
  • PathlessLayoutRouteWithChildren (86-88)
  • PathlessLayoutNestedLayoutRouteWithChildren (77-80)
  • PostsRouteRouteChildren (63-66)
  • PathlessLayoutNestedLayoutRouteChildren (72-75)
  • PathlessLayoutRouteChildren (82-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test
  • GitHub Check: Preview
🔇 Additional comments (21)
e2e/solid-router/generator-cli-only/.gitignore (1)

1-11: Gitignore configuration looks good.

The patterns are appropriate for a Vite project with Playwright e2e tests, covering dependency folders, build output, test artifacts, and platform-specific files. The file structure is clean and follows standard conventions.

e2e/solid-router/generator-cli-only/tsconfig.json (1)

1-16: TypeScript configuration properly aligned with project standards.

The configuration correctly establishes strict mode TypeScript checking with appropriate settings for a Vite+SolidJS environment. JSX is properly configured to preserve source format and import from solid-js, and module resolution is set to Bundler for compatibility with Vite. The strict compiler option ensures extensive type safety across this e2e test suite, aligning with project guidelines. Based on learnings

e2e/solid-router/generator-cli-only/postcss.config.mjs (1)

1-5: LGTM!

The PostCSS configuration correctly uses the @tailwindcss/postcss plugin for Tailwind CSS v4 integration.

e2e/solid-router/generator-cli-only/src/routes/__root.tsx (1)

1-61: LGTM!

The root route configuration is well-structured with proper navigation, error handling for not-found routes, and devtools integration. The Tailwind utilities are compatible with v4, and the intentional type error for the non-existent route appropriately tests 404 behavior.

e2e/solid-router/generator-cli-only/tsr.config.json (1)

1-5: LGTM!

The TanStack Router configuration is correctly structured with appropriate paths and target framework.

e2e/solid-router/generator-cli-only/index.html (1)

1-12: LGTM!

The HTML entry point is properly structured with all necessary meta tags and script references for a Vite-based Solid application.

e2e/solid-router/generator-cli-only/tests/setup/global.setup.ts (1)

1-6: LGTM!

The global setup correctly uses modern import attributes syntax and properly initializes the e2e test server.

e2e/solid-router/generator-cli-only/tests/setup/global.teardown.ts (1)

1-6: LGTM!

The global teardown correctly mirrors the setup file and properly cleans up the e2e test server.

e2e/solid-router/generator-cli-only/tests/app.spec.ts (1)

1-35: LGTM!

The end-to-end test suite comprehensively covers the main routing scenarios including post navigation, nested pathless layouts, and not-found behavior. The test structure follows Playwright best practices with proper setup, locators, and assertions.

e2e/solid-router/generator-cli-only/src/styles.css (1)

9-9: The CSS variable --color-gray-200 is provided by default in Tailwind v4.

Tailwind v4's default theme includes --color-gray-200: oklch(0.929 0.013 255.508), and since the Tailwind v4 update the default and recommended way of managing and using colors is with native CSS variables. When you use @import 'tailwindcss' (as all files in this codebase do), these variables are automatically available. The code is correct as-is and requires no changes.

e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout.tsx (1)

1-34: LGTM!

The nested pathless layout is well-structured with proper route definition, navigation links, and outlet rendering. The Tailwind v4 classes used here are standard utilities that remain unchanged in v4.

e2e/solid-router/generator-cli-only/src/routes/index.tsx (1)

1-13: LGTM!

Clean root route implementation with proper route definition and simple home component.

e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout/_nested-layout/route-b.tsx (1)

1-11: LGTM!

Simple and correct route definition for Layout B.

e2e/solid-router/generator-cli-only/src/routes/_pathlessLayout.tsx (1)

1-16: LGTM!

Pathless layout correctly implements the layout pattern with proper outlet rendering for nested routes.

e2e/solid-router/generator-cli-only/src/routes/posts.index.tsx (1)

1-9: LGTM!

Clean posts index route with appropriate placeholder component.

e2e/solid-router/generator-cli-only/vite.config.js (1)

1-7: LGTM!

Standard Vite configuration with Solid plugin, appropriate for the e2e test environment.

e2e/solid-router/generator-cli-only/playwright.config.ts (1)

1-41: LGTM!

Well-configured Playwright setup for e2e testing with appropriate port management, global hooks, and single-worker execution for test stability.

e2e/solid-router/generator-cli-only/package.json (1)

13-22: LGTM!

Dependencies are correctly configured with workspace:^ protocol for internal packages as per coding guidelines, and Tailwind v4.1.15 is properly included.

e2e/solid-router/generator-cli-only/src/main.tsx (2)

1-12: Bootstrap looks solid.

Router config and guarded render are standard and correct.


1-4: No action required—both dependencies are already present.

The e2e package.json already declares @tanstack/solid-router (workspace:^) and redaxios (^0.5.1) in dependencies. No missing packages to add.

e2e/solid-router/generator-cli-only/src/routes/posts.$postId.tsx (1)

5-12: Ensure loader throws NotFoundError for missing posts to hit notFoundComponent.

With the proposed fetchPost change (404→NotFoundError), this notFoundComponent will render “Post not found” instead of the generic error UI.

After updating fetchPost, re-run the e2e step that clicks “Non-existent Post” and confirm this component renders.

@@ -0,0 +1,29 @@
{
"name": "tanstack-solid-router-e2e-react-generator-cli-only",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix incorrect package name reference.

The package name contains "react" but this is a Solid Router e2e test suite. The name should reflect that it's for Solid, not React.

Apply this diff to correct the package name:

-  "name": "tanstack-solid-router-e2e-react-generator-cli-only",
+  "name": "tanstack-solid-router-e2e-solid-generator-cli-only",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"name": "tanstack-solid-router-e2e-react-generator-cli-only",
"name": "tanstack-solid-router-e2e-solid-generator-cli-only",
🤖 Prompt for AI Agents
In e2e/solid-router/generator-cli-only/package.json around line 2, the package
name incorrectly contains "react"; update the "name" field to reference "solid"
instead of "react" so it reflects the Solid Router e2e test suite (e.g., replace
"tanstack-solid-router-e2e-react-generator-cli-only" with a name that uses
"solid" such as "tanstack-solid-router-e2e-solid-generator-cli-only" or similar
project naming consistent with other Solid e2e packages).

Comment on lines +24 to +36
export const fetchPost = async (postId: string) => {
console.info(`Fetching post with id ${postId}...`)
const post = await axios
.get<PostType>(`${queryURL}/posts/${postId}`)
.then((r) => r.data)

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!post) {
throw new NotFoundError(`Post with id "${postId}" not found!`)
}

return post
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Map 404s (and empty payloads) to NotFoundError so route notFoundComponent renders.

As written, axios 404 rejects before if (!post) runs, so the not-found UI won’t show. Catch 404s and throw NotFoundError; also validate empty bodies and encode the param.

Apply this diff:

-export const fetchPost = async (postId: string) => {
-  console.info(`Fetching post with id ${postId}...`)
-  const post = await axios
-    .get<PostType>(`${queryURL}/posts/${postId}`)
-    .then((r) => r.data)
-
-  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
-  if (!post) {
-    throw new NotFoundError(`Post with id "${postId}" not found!`)
-  }
-
-  return post
-}
+export const fetchPost = async (postId: string) => {
+  console.info(`Fetching post with id ${postId}...`)
+  try {
+    const post = await axios
+      .get<PostType | null>(`${queryURL}/posts/${encodeURIComponent(postId)}`)
+      .then((r) => r.data)
+
+    // Treat null/empty payloads as not found
+    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+    if (!post || !(post as any).id) {
+      throw new NotFoundError(`Post with id "${postId}" not found!`)
+    }
+    return post
+  } catch (err: any) {
+    const status = err?.response?.status ?? err?.status
+    if (status === 404) {
+      throw new NotFoundError(`Post with id "${postId}" not found!`)
+    }
+    throw err
+  }
+}
🤖 Prompt for AI Agents
In e2e/solid-router/generator-cli-only/src/posts.ts around lines 24 to 36, the
axios call will reject on 404 so the existing null-check never runs and the
notFoundComponent won’t render; wrap the request in a try/catch, use
encodeURIComponent(postId) in the URL, and in the catch map a 404 response to
throw new NotFoundError(postId) while rethrowing other errors; after the request
also verify the response body is present and throw NotFoundError if it’s empty.

@birkskyum birkskyum merged commit 9bc2969 into main Oct 25, 2025
6 checks passed
@birkskyum birkskyum deleted the test(solid-router)--generator-cli-only branch October 25, 2025 23:21
@birkskyum birkskyum added this to the catch up solid to react milestone Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants